home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / RenRenderMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.0 KB  |  114 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  13 April 1997
  22. // Author:         gf
  23. //
  24. //
  25. //  Procedure Name:
  26. //      RenRenderMenu
  27. //
  28. //  Description:
  29. //        Create the RENDERING->Render menu
  30. //
  31. //  Input Arguments:
  32. //      parent to parent the menu to.
  33. //
  34. //  Return Value:
  35. //      None.
  36. //
  37.  
  38. //
  39. // Description: Called when user opens the main render menu.
  40. //                This procedure calls the render menu building UI specific to the current
  41. //                renderer.
  42. //    Returns:    None
  43. //
  44. global proc RenRenderMenu( string $parent )
  45. {
  46.     setParent -m $parent;
  47.  
  48.     if( `menu -q -ni $parent` != 0 ) {
  49.         updateMayaRenderMenu($parent);
  50.         return;
  51.     }
  52.  
  53.     // Build the pulldown render menu.
  54.     //
  55.     mayaRenderMenu($parent);
  56.  
  57.     setParent -m $parent;
  58.     menuItem -divider true;
  59.  
  60.     //....
  61.     // Create submenu to allow for renderer selection
  62.  
  63.     menuItem
  64.         -subMenu                true
  65.         -label                    "Render using"
  66.         -annotation
  67.             "Change current renderer"
  68.         ("renMenuRenderUsingItemMenuItem");
  69.  
  70.     menuItem
  71.         -edit
  72.         -postMenuCommand
  73.             ("buildRenderMenuRenderUsingSubmenu renMenuRenderUsingItemMenuItem")
  74.         ("renMenuRenderUsingItemMenuItem");
  75. }
  76.  
  77. // Description:    Builds the "Render Using" submenu that allows the user to select
  78. //                from the available renderers
  79. //    Returns:     None
  80. //
  81. global proc buildRenderMenuRenderUsingSubmenu(string $subMenuName)
  82. {
  83.     popupMenu -e -deleteAllItems $subMenuName;
  84.     setParent -m $subMenuName;
  85.  
  86.     string $renderers[] = `renderer -query -namesOfAvailableRenderers`;
  87.     int $isCurrent  = 0;
  88.     string $funcName = "";
  89.     string $rendererUIName = "";
  90.  
  91.     radioMenuItemCollection    ("renderWindowRenderUsingCollection" + $subMenuName);
  92.     
  93.     for ($i = 0; $i < size($renderers); $i += 1)
  94.     {
  95.         if($renderers[$i] == currentRenderer())
  96.         {
  97.             $isCurrent = 1;
  98.         }
  99.         else
  100.         {
  101.             $isCurrent = 0;
  102.         }
  103.  
  104.         $funcName = "setCurrentRenderer " + $renderers[$i];
  105.         $rendererUIName = `renderer -query -rendererUIName $renderers[$i]`; 
  106.  
  107.         menuItem -l $rendererUIName
  108.              -radioButton             $isCurrent
  109.              -collection            ("renderWindowRenderUsingCollection" + $subMenuName)
  110.              -c  $funcName
  111.              ("renderUsingItemSubMenu" + $i);
  112.     }
  113. }
  114.